package com.chenglu.android.order.adapter;

import android.content.Context;
import android.view.View;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.chenglu.android.R;
import com.chenglu.android.common.utils.GlideUtils;
import com.chenglu.android.common.utils.Utils;
import com.chenglu.android.order.bean.OrderInfoBean;

import java.util.List;

/**
 * @author: lyj
 * @Created: by Copyright 2023/3/29 Guangzhou Hongma Technology Co., Ltd. All rights reserved.
 * @Description：我的全部订单item 横向布局
 */
public class AllOrderItemListAdapter extends BaseQuickAdapter<OrderInfoBean.Data.Records.OrderDetails, BaseViewHolder> {
     Context mContext;

    public AllOrderItemListAdapter(Context context, @Nullable List<OrderInfoBean.Data.Records.OrderDetails> data) {
        super(R.layout.item_order_item_1, data);
        this.mContext = context;
    }

    @Override
    protected void convert(@NonNull BaseViewHolder helper, OrderInfoBean.Data.Records.OrderDetails item) {
        helper.setText(R.id.tv_cart_goodsName, item.getGoodsVO().getGoodsName()); //商品名称
        ImageView imageView = helper.getView(R.id.iv_cart_goodsImg);
        GlideUtils.setImageView(mContext,item.getGoodsVO().getGoodsImg(),imageView,8);
//        helper.addOnClickListener(R.id.iv_cart_goodsimg); //点击事件

    }
}
